﻿using System;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace Negocio
{
    public class Activity: PersistentObject
    {
        private string description;
        private string type;
        private int series;
        private int time;
        private int repetitions;
        private int pauseTime;
        private ObservableCollection<ReferenceMeasure> referenceMeasures;


        public Activity()
        {
            this.Description = "";
            this.Type = "";
            this.Series = 0;
            this.Time = 0;
            this.Repetitions = 0;
            this.PauseTime = 0;
            this.ReferenceMeasures = new ObservableCollection<ReferenceMeasure>();

        }

        public string Description 
        {
            get { return this.description; }
            set { this.description = value;}
        }

        public string Type 
        {
            get { return this.type;}
            set { this.type = value;}
        }

        public int Series 
        {
            get { return this.series;}
            set { this.series = value;}
        }

        public int Time 
        {
            get { return this.time;}
            set { this.time = value;}
        }

        public int Repetitions 
        {
            get { return this.repetitions;}
            set { this.repetitions = value;}
        }

        public int PauseTime 
        {
            get { return this.pauseTime;}
            set { this.pauseTime = value;}
        }

        public ObservableCollection<ReferenceMeasure> ReferenceMeasures 
        {
            get { return this.referenceMeasures; }
            set { this.referenceMeasures = value; }
        }

        public bool addReferenceMeasure(ReferenceMeasure oneReferenceMeasure)
        {
            bool ret = false;
            if (!this.ReferenceMeasures.Contains(oneReferenceMeasure)) 
            {
                this.ReferenceMeasures.Add(oneReferenceMeasure);
                ret = true;
            }
            return ret;
        }

        public void deleteReferenceMeasure(ReferenceMeasure oneReferenceMeasure)
        {
            this.ReferenceMeasures.Remove(oneReferenceMeasure);
        }

        public override bool Equals(object obj)
        {
            return this.Description.Equals(((Activity)obj).Description);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
       
    }
}
